---
title: Retrieve hazard groups effective on a date
summary: Loads hazard groups in force on a given effective date via the BOF data portal.
status: draft
owner: SAIF Documentation Generator
last_reviewed: 2026-08-21
library: SAIF.Business.Policy
reference_type: package
operation_id: op-01-retrieve-hazard-groups
trigger: Caller invokes GetHazardGroups(inDataportal, inEffectiveDate)
---

# Retrieve hazard groups effective on a date

Loads all hazard groups in force on a caller-supplied effective date, returning a populated `clsHazardGroupCollection`.

| Field | Value |
| --- | --- |
| **Operation ID** | op-01-retrieve-hazard-groups |
| **Trigger** | Caller invokes `GetHazardGroups` (or the deprecated `<Obsolete>` twin `GetHazardGroupCollection`) |
| **Inputs** | `IDataPortalInfo`, effective date |
| **Outputs** | Populated `clsHazardGroupCollection` |
| **Primary components** | `clsHazardGroupCollection.GetHazardGroups`, `Criteria` |
| **Entry point** | SAIF.Business.Policy/clsHazardGroupCollection.vb |

## Steps

1. Construct `Criteria(inDataportal, inEffectiveDate)`, storing the effective date on the criteria object. No validation of the date is performed ([BR-POL-002](../business-rules.md#br-pol-002-hazard-group-data-is-read-only)).
2. Call `inDataportal.DataAccessLayer.RetrieveObject(criteria)` — delegates to the BOF data portal in `SAIF.BOF.Framework` (framework-inherited; retrieval orchestration is implemented in the framework, not here).*
3. Framework invokes `BeforeRetrieve`: creates a new `IDataRequest`, assigns `MyCriteria.RetrieveSQL` ([SQL-002](../sql/SQL-002-hazard-group-retrieve.md), table [HAZARD_GROUP](../database-tables.md#hazard_group)), and binds parameter `EffectiveDate` from `MyCriteria.EffectiveDate` ([BR-POL-001](../business-rules.md#br-pol-001-hazard-group-effective-dating)).
4. Framework executes the request against Oracle.
5. Framework invokes `AfterRetrieve`: casts `inPortalRequest.DataRequest(0).Result` to `IDataReader` and loops `Reader.Read`.
6. Per row: `New clsHazardGroup` → `child.Load(CriteriaObject.DataPortalInfo, Reader)` → `Add(child)` (see [Hydrate a hazard group from a reader](op-02-hydrate-hazard-group.md)).
7. Returns `Me` (the collection) to the caller; result is cast to `clsHazardGroupCollection`.

## Process flow

The following diagram visualizes this operation's control flow.

```mermaid
flowchart TD
	Start(["Caller invokes<br>GetHazardGroups"]) --> A["Construct Criteria with<br>effective date"]
	A --> B["RetrieveObject via BOF data<br>portal"]
	B --> C["BeforeRetrieve assigns<br>RetrieveSQL and binds<br>EffectiveDate"]
	C --> D["Framework executes request<br>against Oracle"]
	D --> E["AfterRetrieve reads rows via<br>reader"]
	E --> F{More rows?}
	F -->|Yes| G["New clsHazardGroup / Load /<br>Add to collection"]
	G --> F
	F -->|No| End(["Return populated<br>clsHazardGroupCollection"])
```

## Failure and edge-case behavior
- An empty result set yields an empty collection; no explicit exception handling — data-access exceptions propagate to the caller.
- `IDataAccess.RetrieveObject` and portal-request execution are implemented in `SAIF.BOF.Framework` (NuGet). Their internal step sequence was not retrieved for this run.**

> **Note:** Statements marked with * were inferred from code structure, naming conventions, or
> contextual evidence where direct confirmation was not available in source artifacts. Statements
> marked with ** could not be confirmed; treat as unknown until verified.

## Related documentation
- [Operations and processes](../operations-processes.md)
- [Business rules](../business-rules.md)
- [SQL catalog](../sql/index.md)
- [Database tables](../database-tables.md)

## Sources
- `SAIF.Business.Policy/clsHazardGroupCollection.vb`
